From 95942d7cab829ad0affc9f93fd1fe226ec445b39 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 29 May 2008 09:39:23 +0100 Subject: [PATCH] vtd: addr_to_dma_page_maddr() must release its lock. Signed-off-by: Xiaowei Yang --- xen/drivers/passthrough/vtd/iommu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 777739d49d..bdd049ba4b 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -212,10 +212,10 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc) if ( hd->pgd_maddr == 0 ) { if ( !alloc ) - return 0; + goto out; hd->pgd_maddr = alloc_pgtable_maddr(); if ( hd->pgd_maddr == 0 ) - return 0; + goto out; } parent = (struct dma_pte *)map_vtd_domain_page(hd->pgd_maddr); @@ -263,6 +263,7 @@ static u64 addr_to_dma_page_maddr(struct domain *domain, u64 addr, int alloc) } unmap_vtd_domain_page(parent); + out: spin_unlock_irqrestore(&hd->mapping_lock, flags); return pte_maddr; } -- 2.30.2